<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/1/10
 * Time: 9:28
 * 删除文章
 */

include_once('admin_global.php');
$db->Get_user_shell_check($uid, $shell);   //检测用户是否登录

$newsID = $_GET['newsID'];            //获得文章ID
$sql = "DELETE FROM news WHERE newsID=$newsID";
$query = $db->query($sql);
if ($query == true) {
    if($_SESSION['userType']=='普通管理员'){
        echo "<script>alert('文章删除成功！');location.href='listNews.php';</script>";
    }else{
        echo "<script>alert('文章删除成功！');location.href='listMyNews.php';</script>";
    }
}
?>